<div class="layuimini-container layuimini-page-anim">
    <div class="layuimini-main">

        <fieldset class="table-search-fieldset">
            <legend>搜索信息</legend>
            <div style="margin: 10px 10px 10px 10px">
                <form class="layui-form layui-form-pane" action="">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">用户姓名</label>
                            <div class="layui-input-inline">
                                <input type="text" name="user_name" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">用户手机</label>
                            <div class="layui-input-inline">
                                <input type="text" name="phone" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <button type="submit" class="layui-btn layui-btn-primary"  lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
                        </div>
                    </div>
                </form>
            </div>
        </fieldset>

        <script type="text/html" id="toolbarDemo">
            <div class="layui-btn-container">
                <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add" href="asdasdsd" > 添加 </button>
                <button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete"> 删除 </button>
            </div>
        </script>

        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>

        <script type="text/html" id="currentTableBar">
            <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
			<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="reset">重置密码</a>
            <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
        </script>

    </div>
</div>
<script type="text/html" id="roleTpl">
  {{#  layui.each(d.role_list, function(index, item){ }}
        <span>{{ item.name }}</span>
    {{#  }); }}
</script>
<script>
	
    layui.use(['form', 'table','miniPage','element','hsw'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table,
            miniPage = layui.miniPage;
			hsw = layui.hsw;
		hsw.hsw_table('currentTableId', HSW_API_MANAGE_USER_LIST, [
        	            {type: "checkbox", width: 50},
        				{field: 'pid', width: 200, title: '主键ID'},
        				{field: 'user_name', width: 150, title: '用户名', sort: true},
        				{field: 'real_name', title: '昵称', minWidth: 150},
        				{field: 'phone', width: 120, title: '手机号', sort: true},
						{field: 'role_list',width:250,title:'角色名称',templet: '#roleTpl'},
        	            {field: 'create_time', width: 180, title: '创建时间', sort: true},
        	            {field: 'last_update_time', width: 180, title: '最后修改时间'},
        	            {field: 'remark', width: 150, title: '备注', sort: true},
        	            {title: '操作', minWidth: 200, toolbar: '#currentTableBar', align: "center"}
        	        ],true);
		hsw.hsw_search('data-search-btn','currentTableId');
		hsw.hsw_table_tool('currentTableFilter','currentTableId',
			{add:{
				title:'用户新增',
				html:'page/manage/user/add.html'
			},edit:{
				title:'用户修改',
				html:'page/manage/user/edit.html'
			},del:{
				url:HSW_API_MANAGE_USER_DEL
			},info:{
				url:HSW_API_MANAGE_USER_INFO
			},reset:{
				url:HSW_API_MANAGE_USER_RESET_PASSWORD
			}});
     
    });
</script>